package top.kaoshanji.p1ch02a;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.lang.reflect.Array;

/**
 * 代码清单 p1ch02a-06：使用反射API操作数组(2.2.4节)
 * author kaoshanji
 * ^_^
 * create time 2024/12/23 15:47
 */
public class ArrayUsage {

    private static final Logger logger = LogManager.getLogger(ArrayUsage.class);

    public static void main(String[] args) {
        logger.info("...代码清单 p1ch02a-06：使用反射API操作数组(2.2.4节)...");

        String[] names = (String[]) Array.newInstance(String.class, 1);
        names[0] = "Hello";

        System.out.println(names[0]);

    }

}
